package com.compass.doctor.ui.chat

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.doctor.databinding.LayoutImDrugItemBinding
import com.compass.framework.adapter.BaseBindViewHolder
import com.compass.framework.adapter.BaseRecyclerViewAdapter
import com.compass.framework.model.ImDrug

/**
 * Description： im药品列表
 * Date:2024/2/20 15:12
 */
class ImDrugAdapter : BaseRecyclerViewAdapter<ImDrug, LayoutImDrugItemBinding>() {


    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutImDrugItemBinding>,
        item: ImDrug?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            tvName.text = item.name
            tvNumber.text = "x"+item.num


        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutImDrugItemBinding {
        return LayoutImDrugItemBinding.inflate(layoutInflater, parent, false)
    }
}